import request from '@/utils/request'

/**
 * 物料信息分页查询
 * @param {查询条件} data
 */
export function pageBaseMaterial(query) {
	return request({
		url: 'BaseManage/BaseMaterial/pageList',
		method: 'get',
		params: query,
	})
}

/**
 * 新增物料信息
 * @param data
 */
export function addBaseMaterial(data) {
	return request({
		url: 'BaseManage/BaseMaterial',
		method: 'post',
		data: data,
	})
}
/**
 * 修改物料信息
 * @param data
 */
export function updateBaseMaterial(data) {
	return request({
		url: 'BaseManage/BaseMaterial',
		method: 'PUT',
		data: data,
	})
}
/**
 * 获取物料信息详情
 * @param {Id}
 */
export function getBaseMaterial(id) {
	return request({
		url: 'BaseManage/BaseMaterial/' + id,
		method: 'get'
	})
}

/**
 * 删除物料信息
 * @param {主键} pid
 */
export function delBaseMaterial(pid) {
	return request({
		url: 'BaseManage/BaseMaterial/delete',
		method: 'POST',
		data: pid
	})
}

// 导出物料信息
export async function exportBaseMaterial(query) {
	await downFile('BaseManage/BaseMaterial/export', { ...query })
}